package vista;
import java.awt.BorderLayout;
import java.awt.event.ActionListener;

import javax.swing.ComboBoxModel;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.ListModel;

import javax.swing.WindowConstants;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableModel;
import javax.swing.SwingUtilities;


/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class VistaCompetencia extends javax.swing.JFrame {
	private JPanel jPanelPrincipal;
	private JLabel jlblmodalidad;
	private JList jListcarrilesfemeninos;
	private JButton btnguardar;
	private JComboBox jcmbmodalidad;
	private JTextField jtxthora;
	private JTextField jtxtfecha;
	private JTextField jtxtcodigo;
	private JLabel jlblhora;
	private JLabel jlblfecha;
	private JLabel jlblcodigo;

	/**
	* Auto-generated main method to display this JFrame
	*/
	public static void main(String[] args) {
		SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				VistaCompetencia inst = new VistaCompetencia();
				inst.setLocationRelativeTo(null);
				inst.setVisible(true);
			}
		});
	}
	
	public VistaCompetencia() {
		super();
		initGUI();
	}
	
	private void initGUI() {
		try {
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			{
				jPanelPrincipal = new JPanel();
				getContentPane().add(jPanelPrincipal, BorderLayout.CENTER);
				jPanelPrincipal.setLayout(null);
				jPanelPrincipal.setPreferredSize(new java.awt.Dimension(753, 374));
				{
					jlblcodigo = new JLabel();
					jPanelPrincipal.add(jlblcodigo);
					jlblcodigo.setText("Codigo de la competencia");
					jlblcodigo.setBounds(22, 38, 163, 15);
				}
				{
					jlblfecha = new JLabel();
					jPanelPrincipal.add(jlblfecha);
					jlblfecha.setText("Fecha de la Competencia");
					jlblfecha.setBounds(22, 65, 159, 15);
				}
				{
					jlblhora = new JLabel();
					jPanelPrincipal.add(jlblhora);
					jlblhora.setText("Hora de la competencia");
					jlblhora.setBounds(22, 92, 150, 15);
				}
				{
					jlblmodalidad = new JLabel();
					jPanelPrincipal.add(jlblmodalidad);
					jlblmodalidad.setText("Modalidad de la competencia");
					jlblmodalidad.setBounds(22, 128, 184, 15);
				}
				{
					jtxtcodigo = new JTextField();
					jPanelPrincipal.add(jtxtcodigo);
					jtxtcodigo.setBounds(206, 35, 73, 22);
				}
				{
					jtxtfecha = new JTextField();
					jPanelPrincipal.add(jtxtfecha);
					jtxtfecha.setBounds(207, 62, 72, 22);
				}
				{
					jtxthora = new JTextField();
					jPanelPrincipal.add(jtxthora);
					jtxthora.setBounds(207, 89, 72, 22);
				}
				{

					jcmbmodalidad = new JComboBox();
					jPanelPrincipal.add(jcmbmodalidad);
					jcmbmodalidad.setBounds(212, 124, 67, 22);
				}
				{
					ListModel jListcarrilesfemeninosModel = 
						new DefaultComboBoxModel(
								new String[] { "Item One", "Item Two" });
					jListcarrilesfemeninos = new JList();
					jPanelPrincipal.add(jListcarrilesfemeninos);
					jListcarrilesfemeninos.setModel(jListcarrilesfemeninosModel);
					jListcarrilesfemeninos.setBounds(224, 392, 247, 70);
				}
				{
					btnguardar = new JButton();
					jPanelPrincipal.add(btnguardar);
					btnguardar.setText("GenerarCompetencia");
					btnguardar.setBounds(65, 178, 147, 22);
				}
			}
			pack();
			this.setSize(300, 258);
		} catch (Exception e) {
		    //add your error handling code here
			e.printStackTrace();
		}
	}
	public void agregarListener (ActionListener Action){
		jcmbmodalidad.addActionListener(Action);
		btnguardar.addActionListener(Action);
	}

		public String getcodigo(){
			return jtxtcodigo.getText();}
		
		public String getfecha(){
		    return jtxtfecha.getText();}
		
		public String gethora(){
			return jtxthora.getText(); }
		
		public void setcodigo(String codigo){
			 jtxtcodigo.setText(codigo);
		}
		public void setfecha(String fecha){
			 jtxtfecha.setText(fecha);
		}
		public void sethora(String hora){
			 jtxtfecha.setText(hora);
		}
		
		public String getmodalidad(){
			return jcmbmodalidad.getSelectedItem().toString();
		}
		

		public void setmodalidad (String[] modalidad)
		{
			ComboBoxModel jcmbsetcombo = new DefaultComboBoxModel(modalidad);
			jcmbmodalidad.setModel(jcmbsetcombo);
		}
		
	
}
